From: Jonas Dreßler Date: Fri, 1 Mar 2024 17:39:18 +0000 (+0100) Subject: st/focus-manager: Check for NULL instead of stage to exit loop X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~104^2^2~29 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0df2168b18383452b48d09e0abc7b95be6540d7e;p=gnome-shell.git st/focus-manager: Check for NULL instead of stage to exit loop In st_focus_manager_stage_event() we get the current key-focus actor from the stage, and then enter a loop where we iterate through parents until we get to the stage. If the key-focus actor is not a descendent of the stage for some reason, this loop will never exit and we've locked up. We can easily prevent the endless loop by checking for NULL as the exit condition instead of checking for the stage, so do that instead. Part-of: --- diff --git a/src/st/st-focus-manager.c b/src/st/st-focus-manager.c index a39845d9f..41f3380c4 100644 --- a/src/st/st-focus-manager.c +++ b/src/st/st-focus-manager.c @@ -113,7 +113,7 @@ st_focus_manager_stage_event (ClutterActor *stage, if (!focused) return FALSE; - for (group = focused; group != stage; group = clutter_actor_get_parent (group)) + for (group = focused; group != NULL; group = clutter_actor_get_parent (group)) { if (g_hash_table_lookup (manager->groups, group)) {